feat: support objects in remaining dot array helpers#10269
Conversation
|
Hi there, syawqy! 👋 Thank you for sending this PR! We expect the following in all Pull Requests (PRs).
Important We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. If pull requests do not comply with the above, they will likely be closed. Since we are a team of volunteers, we don't have any more time to work See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md Sincerely, the mergeable bot 🤖 |
|
I had quite a few suggestions, so I thought it would be clearer to open a separate PR: #10296. It is based on your work, so you are still included as a co-author. |
|
Thank you so much, @michalsn! 🙏 I really appreciate you taking the time to extend this instead of just leaving review notes, #10296 covers far more Thanks as well for keeping me as a co-author. I'll go ahead and close this one in favor of #10296. Happy to help test |
|
@syawqy Reviews are always welcome, thanks! |
Description
This is a follow-up to PR #10226, which added object support to
dot_array_search()andarray_group_by().This PR extends the same object-read support to the remaining read-style dot array helpers:
dot_array_has()dot_array_only()dot_array_except()The implementation reuses the existing object access patterns already introduced for PR #10226:
valueExists()value()entityToArray()toIterable()Objects are handled for bounded key/property lookups and wildcard traversal, including
Entity,ArrayObject, public object properties, and magic__isset()/__get()access.Entitywildcard traversal continues to usetoArray()so internal properties are not exposed.dot_array_set()anddot_array_unset()remain array-only because they are mutating helpers.Docs and the v4.8.0 changelog were updated to reflect the expanded object support.
Checklist: